@import './theme.less';

// 全局样式重置
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: @font-family;
  color: @text-primary;
  background-color: @bg-secondary;
  transition: @transition-base;
}

// 自定义滚动条
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: @bg-tertiary;
  border-radius: @radius-sm;
}

::-webkit-scrollbar-thumb {
  background: @border-medium;
  border-radius: @radius-sm;
  transition: @transition-base;
  
  &:hover {
    background: @border-dark;
  }
}

// Mixin 定义
.page-container() {
  padding: @spacing-xl @spacing-lg;
  min-height: calc(100vh - 64px);
  background: @bg-secondary;
}

.card() {
  background: @bg-primary;
  border-radius: @radius-lg;
  box-shadow: @shadow-md;
  border: 1px solid @border-light;
  transition: @transition-base;
  
  &:hover {
    box-shadow: @shadow-lg;
    transform: translateY(-2px);
  }
}

.gradient-bg() {
  background: @bg-gradient;
}

.text-gradient() {
  background: linear-gradient(135deg, @primary-color 0%, @accent-color 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn() {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: @spacing-sm @spacing-lg;
  border: none;
  border-radius: @radius-md;
  font-size: @text-base;
  font-weight: 500;
  cursor: pointer;
  transition: @transition-bounce;
  text-decoration: none;
  
  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
}

.btn-primary() {
  background: @bg-gradient;
  color: white;
  
  &:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: @shadow-glow;
  }
}

.btn-secondary() {
  background: @bg-primary;
  color: @text-primary;
  border: 1px solid @border-light;
  
  &:hover:not(:disabled) {
    border-color: @primary-color;
    color: @primary-color;
  }
}

.btn-sm() {
  padding: @spacing-xs @spacing-md;
  font-size: @text-sm;
}

.btn-lg() {
  padding: @spacing-md @spacing-xl;
  font-size: @text-lg;
}

// 通用工具类
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 @spacing-lg;
}

.page-container {
  .page-container();
}

.card {
  .card();
}

.gradient-bg {
  .gradient-bg();
}

.text-gradient {
  .text-gradient();
}

// 按钮样式
.btn {
  .btn();
  
  &.btn-primary {
    .btn-primary();
  }
  
  &.btn-secondary {
    .btn-secondary();
  }
  
  &.btn-sm {
    .btn-sm();
  }
  
  &.btn-lg {
    .btn-lg();
  }
}

// 输入框样式
.input {
  width: 100%;
  padding: @spacing-sm @spacing-md;
  border: 1px solid @border-light;
  border-radius: @radius-md;
  font-size: @text-base;
  background: @bg-primary;
  color: @text-primary;
  transition: @transition-base;
  
  &::placeholder {
    color: @text-tertiary;
  }
  
  &:focus {
    outline: none;
    border-color: @primary-color;
    box-shadow: 0 0 0 3px @primary-light;
  }
  
  &:hover {
    border-color: @border-medium;
  }
}

// 动画类
.fade-in {
  animation: fadeIn 0.3s ease-in-out;
}

.slide-up {
  animation: slideUp 0.3s ease-out;
}

.bounce-in {
  animation: bounceIn 0.5s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

// 响应式断点
@media (max-width: 768px) {
  .page-container {
    padding: @spacing-md;
  }
  
  .container {
    padding: 0 @spacing-md;
  }
}